package com.bdqn.service.impl;


import com.bdqn.dao.BannerMapper;
import com.bdqn.entity.BannerWithBLOBs;
import com.bdqn.service.BannerService;
import com.bdqn.util.Result;
import com.bdqn.util.ResultType;
import com.bdqn.util.StatusType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("bannerService")
public class BannerServiceImpl implements BannerService {
    @Autowired
    private BannerMapper bannerMapper;

    @Override
    public Result<List<BannerWithBLOBs>> getBanner(String uid, StatusType staType) {

        List<BannerWithBLOBs> list = bannerMapper.selectList(uid,staType.getValue());
        if (list != null && list.size()>0){
            return Result.createSuccess(list);
        }
        return Result.createFalseResult(ResultType.NODATA,"没有查询到数据") ;
    }

}
